package com.foodchain.aspect;

import com.foodchain.annotation.CheckRegister;
import com.foodchain.util.Misc;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class RegisterValid implements ConstraintValidator<CheckRegister, String> {

    @Override
    public void initialize(CheckRegister constraintAnnotation) {
    }

    @Override
    public boolean isValid(String userName, ConstraintValidatorContext constraintValidatorContext) {
        System.out.println("================================>" + Misc.isEmpty(userName));

        return Misc.isNotEmpty(userName);
    }
}
